FROM openjdk:8u342-slim

LABEL user="chris" mail="majewing@126.com" name="supreme-oms-server" group="supreme-server"

EXPOSE 7260

ARG APP_NAME=supreme-oms-server
ARG APP_VER=0.0.1
ARG APP_HOME=/home/${APP_NAME}
RUN mkdir -p ${APP_HOME}

VOLUME ["${APP_HOME}/logs"]

ARG JAR_FILE=${APP_NAME}-${APP_VER}.jar
ADD ./target/${JAR_FILE} ${APP_HOME}/app-server.jar

ARG ArgLabel=ArgLabelDefault
ARG ArgValue=ArgValueDefault
ENV EnvLabel=OmsServerDockerEnvOms

WORKDIR ${APP_HOME}

RUN echo ${ArgLabel} >> server-arg.log
RUN echo ${ArgValue} >> server-arg.log
RUN echo ${EnvLabel} >> server-arg.log

ENTRYPOINT ["java", "-jar", "app-server.jar", "--spring.profiles.active=docker", "--server-custom.docker-env-name=${EnvLabel}"]
CMD ["--server-custom.docker-arg-name=DockerArgDefRun"]